import axios from 'axios'
import { Toast } from 'vant'

const ajax = axios.create({
  baseURL: '/api'
})

ajax.interceptors.request.use(config => {
  Toast({
    type: 'loading',
    message: '加载中...',
    duration: 0
  })
  return config
})

ajax.interceptors.response.use((resp) => {
  Toast.clear()
  return resp
})

export const getEachdoc = () => ajax.get('/home/doctor')
